<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body style="height: 2000px;">
<!-- <p>图片加载中...</p>    
<img src="images/xlx.jpg" alt="" id="imgs">
<script>
imgs.onload=function(){
    document.getElementsByTagName('p')[0].innerHTML='加载完毕'
}
</script> -->

<!-- <input type="text" id="txt">
<script>
var txt=document.getElementById('txt');
txt.onfocus=function(){
    this.style.background='yellow';
}
txt.onblur=function(){
    this.style.background='blue';
}
</script> -->
<script>
document.onscroll=function(){
    console.log(document.documentElement.scrollTop);
}
</script>

</body>
</html>